home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 2859 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.6 KB

  1. Path: mail2news.demon.co.uk!genesis.demon.co.uk
  2. From: Lawrence Kirby <fred@genesis.demon.co.uk>
  3. Newsgroups: comp.lang.c++,comp.lang.c
  4. Subject: Re: Hungarian notation
  5. Date: Sat, 20 Jan 96 01:34:49 GMT
  6. Organization: none
  7. Message-ID: <822101689snz@genesis.demon.co.uk>
  8. References: <4dhkae$an9@blackice.winternet.com> <821890870snz@genesis.demon.co.uk> <30fd5306.3171520@nntp.ix.netcom.com>
  9. Reply-To: fred@genesis.demon.co.uk
  10. X-NNTP-Posting-Host: genesis.demon.co.uk
  11. X-Newsreader: Demon Internet Simple News v1.27
  12. X-Mail2News-Path: genesis.demon.co.uk
  13.  
  14. In article <30fd5306.3171520@nntp.ix.netcom.com>
  15.            miker3@ix.netcom.com "Mike Rubenstein" writes:
  16.  
  17. >I'm sure Lawrence is aware of this, but it's worth noting that while
  18. >casting to long double is almost certainly safe in that it will not
  19. >cause damage, it may not print out anything useful.  It's possible
  20. >that time_t is an integral type that cannot be represented exactly as
  21. >a long double and the least significant bits, that are lost in the
  22. >conversion, may be significant.
  23.  
  24. As Dan has pointed out long double is the only type you can use and be
  25. sure that it doesn't result in undefined behaviour. While loss of
  26. precision is possible the chances of this happening in practice are small.
  27. Of course you have to answer what the use is for printing out a time_t
  28. value. Most likely that is for debugging or it assumes a particular
  29. format. At any rate the result is inherently system specific.
  30.  
  31. -- 
  32. -----------------------------------------
  33. Lawrence Kirby | fred@genesis.demon.co.uk
  34. Wilts, England | 70734.126@compuserve.com
  35. -----------------------------------------
  36.